import request from '@/utils/request'

//获取频道列表
export const getChannels = () => {
    return request({
        method: 'GET',
        url: '/v1_0/user/channels',
    })
}

//请求获取文章列表数据
export const getArticleList = params => {
    return request({
        method: 'GET',
        url: '/v1_0/articles',
        params
    })
}


//获取全部频道列表
export const getChannelsList = () => {
    return request({
        method: 'GET',
        url: '/v1_0/channels',
    })
}

//添加用户频道
export const addUserChannel = channel => {
    return request({
        method: 'PATCH',
        url: '/v1_0/user/channels',
        data: {
            channels: [channel]
        }
    })
}


//删除频道
export const deleteChannel = id => {
    return request({
        method: 'DELETE',
        url: `v1_0/user/channels/${id}`,
    })
}